<template name="traclerstar">
	<view class="movie-score-wapper">
		<view>
			<image v-for="(item,index) in yellowscore" :key='index' src="http://www.imovietrailer.com/static/icos/star-yellow.png" class="star"></image>
			
			<image v-for="(item,index) in grayscore" :key='index' src="http://www.imovietrailer.com/static/icos/star-gray.png" class="star"></image>
			<!-- <view class="score">{{item.score}}</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		name:'traclerstar',
		data() {
			return {
				yellowscore:0,
				grayscore:5
			};
		},
		props:{
			innerscore:0, //定义外部传入
			showNum:0 //是否显示具体分数 1显示 0不显示
			
		},
		//生命周期，组件创建完成后被调用
		created(){
			var tempscore=0;
			if(this.innerscore!=null&&this.innerscore!=""&&this.innerscore!=undefined){
					tempscore=this.innerscore
			}
			var yellowscore=parseInt(tempscore/2);
			var grayscore=5-yellowscore;
			this.yellowscore=yellowscore;
			this.grayscore=grayscore;
			
		}
		
	}
</script>

<style>
	.movie-score-wapper{
		/* margin-left: 10px; */
		display:inline-block;
	}
	.star{
		width:10px;
		height:10px;
		display: inline-block;
		
	}
	.score{
		display: inline-block;
		color:#808080;
		font-size: 12px;
		margin-left: 5px;
	}
</style>
